package com.billing.service;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.billing.model.entity.TRecord;

public interface RecordService {
	/**
	 * 新增审批记录数据
	 * @param leave
	 * @return
	 */
	public int insertTRecord(TRecord record);
	/**
	 * 获取审批或抄送记录数据
	 * @param docunid
	 * @param userid
	 * @param recordtype
	 * @return
	 */
	public TRecord selectTRecordByDocunid(@Param("docunid")String docunid,@Param("userid")String userid,@Param("recordtype")String recordtype);
	/**
	 * 获取审批或抄送记录数据
	 * @param docunid
	 * @param userid
	 * @param recordtype
	 * @return
	 */
	public TRecord getTRecordByDocunid(@Param("docunid")String docunid,@Param("recordtype")String recordtype);
	
	/**
	 * 获取下个审批记录数据
	 * @param docunid
	 * @param nodesort
	 * @return
	 */
	public TRecord getTRecordByDidAndSort(@Param("docunid")String docunid,@Param("nodesort")String nodesort);
	/**
	 * 更新记录数据
	 * @param record
	 * @return
	 */
	public int updateTRecord(TRecord record);
	/**
	 * 更新抄送记录数据 状态
	 * @param docunid
	 * @return
	 */
	public int updateTRecordCopyStatus(@Param("docunid")String docunid,@Param("starttime")String starttime);
	/**
	 * 查询记录数据是否存在抄送状态
	 * @param docunid
	 * @return
	 */
	public int getRecordCopyNum(@Param("docunid")String docunid);
	/**
	 * 获取已读的条数
	 * @param userid 
	 * @param doctype 审批文档类型
	 * @param searchStr 搜索条件
	 * @return
	 */
	public int getIfHandleRecordNum(@Param("userid")String userid,@Param("doctype")String doctype,
			@Param("docstatus")String docstatus,@Param("searchStr")String searchStr);
	/**
	 * 获取已读数据
	 * @param userid 
	 * @param doctype 审批文档类型
	 * @param searchStr 搜索条件
	 * @return
	 */
	public List<TRecord> getIfHandleRecordList(@Param("userid")String userid,@Param("doctype")String doctype,
			@Param("docstatus")String docstatus,@Param("searchStr")String searchStr,
					@Param("currentPage")int currentPage,@Param("pageSize")int pageSize);
	
	/**
	 * APP获取文档的流转记录
	 * @param docid
	 * @return
	 */
	public List<TRecord> getRecordListByApp(@Param("docid")String docid);
}
